<!DOCTYPE html>
<html xmlns:th="http://www.w3.org/1999/xhtml">
<head>
    <meta charset="UTF-8">
    <title>AdminLTE | LogAnalysis</title>
    <meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
    <!-- bootstrap 3.0.2 -->
    <link href="../static/css/bootstrap.min.css" rel="stylesheet" type="text/css"/>
    <!-- font Awesome -->
    <link href="../static/css/font-awesome.min.css" rel="stylesheet" type="text/css"/>
    <!-- Ionicons -->
    <link href="../static/css/ionicons.min.css" rel="stylesheet" type="text/css"/>
    <!-- Theme style -->
    <link href="../static/css/AdminLTE.css" rel="stylesheet" type="text/css"/>
    <link href="../static/css/glmapp.css" rel="stylesheet" type="text/css">
</head>
<body class="skin-blue">
<!-- header logo: style can be found in header.less -->
<header class="header">
    <a href="index.html" class="logo">
        <!-- Add the class icon to your logo image or logo icon to add the margining -->
        AdminLTE
    </a>
    <!-- Header Navbar: style can be found in header.less -->
    <nav class="navbar navbar-static-top" role="navigation">
        <!-- Sidebar toggle button-->
        <a href="#" class="navbar-btn sidebar-toggle" data-toggle="offcanvas" role="button">
            <span class="sr-only">切换导航</span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
        </a>
        <div class="navbar-right">
            <ul class="nav navbar-nav">
                <!-- User Account: style can be found in dropdown.less -->
                <li class="dropdown user user-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <i class="glyphicon glyphicon-user"></i>
                        <span>个人中心<i class="caret"></i></span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- User image -->
                        <li class="user-header bg-light-blue">
                            <img src="../static/img/pers/rw1.png" class="img-circle" alt="User Image"/>
                            <p>
                                我
                            </p>
                        </li>
                        <!-- Menu Body -->
                        <li class="user-body">
                            <div class="col-xs-4 text-center">
                                <a href="/findManger">个人信息</a>
                            </div>
                            <div class="col-xs-4 text-center">
                                <a href="/findAllLogs">操作日志</a>
                            </div>
                            <div class="col-xs-4 text-center">
                                <a href="/login">退出登录</a>
                            </div>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
</header>
<div class="wrapper row-offcanvas row-offcanvas-left">
    <!-- Left side column. contains the logo and sidebar -->
    <aside class="left-side sidebar-offcanvas">
        <!-- sidebar: style can be found in sidebar.less -->
        <section class="sidebar">
            <!-- Sidebar user panel -->
            <div class="user-panel">
                <div class="pull-left image">
                    <img src="../static/img/pers/rw1.png" class="img-circle" alt="User Image"/>
                </div>
                <div class="pull-left info">
                    <p>你好，管理员</p>

                    <a href="#"><i class="fa fa-circle text-success"></i> 在线</a>
                </div>
            </div>
            <!-- search form -->
            <form action="#" method="get" class="sidebar-form">
                <div class="input-group">
                    <input type="text" name="search" class="form-control" placeholder="搜索..."/>
                    <span class="input-group-btn">
                                <button type='submit' name='searchtoUrl' id='search-btn' class="btn btn-flat"><i
                                        class="fa fa-search"></i></button>
                            </span>
                </div>
            </form>
            <!-- /.search form -->
            <!-- sidebar menu: : style can be found in sidebar.less -->
            <ul class="sidebar-menu">
                <li>
                    <a href="index.html">
                        <i class="fa fa-dashboard"></i> <span>首页</span>
                    </a>
                </li>
                <li class="treeview active">
                    <a href="#">
                        <i class="fa fa-bar-chart-o"></i>
                        <span>日志管理</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="/LogCatchPre"><i class="fa fa-angle-double-right"></i> 日志获取</a></li>
                        <li ><a href="LogAnalysis.html"><i class="fa fa-angle-double-right"></i> 日志分析</a></li>
                        <li class="active"><a href="/findWaitLog"><i class="fa fa-angle-double-right"></i> 日志报警</a></li>
                    </ul>
                </li>
                <li class="treeview">
                    <a href="#">
                        <i class="fa fa-table"></i> <span>系统管理</span>
                        <i class="fa fa-angle-left pull-right"></i>
                    </a>
                    <ul class="treeview-menu">
                        <li><a href="/SysRightPre"><i class="fa fa-angle-double-right"></i> 权限管理</a></li>
                        <li><a href="/PersRightPre"><i class="fa fa-angle-double-right"></i> 人员管理</a></li>
                    </ul>
                </li>
                <li>
                    <a href="calendar.html">
                        <i class="fa fa-calendar"></i> <span>日历</span>

                    </a>
                </li>
                <li>
                    <a href="/findAllMailsInBox">
                        <i class="fa fa-envelope"></i> <span>邮箱</span>

                    </a>
                </li>
            </ul>
        </section>
        <!-- /.sidebar -->
    </aside>
    <!-- Right side column. Contains the navbar and content of the page -->
    <aside class="right-side">

        <!-- Main content -->
        <section class="content-header no-margin">
            <h1 class="text-center">
                日志处理统计
            </h1>
        </section>
        <div class="content">
            <div class="gaea-view ng-scope">
                <div class="gaea-navbar ng-scope" ui-view="navbar">
                    <div class="navbar-resource ng-scope">
                        <div class="resource-navbar">
                            <div class="resource-menu">
                                <ul class="resource-breadcrumb clearfix1">
                                    <li iam-disabled class="basic-operation" style="display: list-item;">
                                        <a ui-sref="gaea.user.profile" ui-sref-active="actived" class="ng-binding "
                                          href="/findWaitLog">待接收日志</a>
                                    </li>
                                    <li class="basic-operation">
                                        <a ui-sref="gaea.user.oplog" ui-sref-active="actived" class="ng-binding "
                                           href="/findLogs">已接收日志</a>
                                    </li>
                                    <li iam-disabled class="basic-operation" style="display: list-item;">
                                        <a ui-sref="gaea.user.profile" ui-sref-active="actived" class="ng-binding "
                                           href="/findSolvedLogs">已处理日志</a>
                                    </li>
                                    <li iam-disabled class="basic-operation" style="display: list-item;">
                                        <a ui-sref="gaea.user.profile" ui-sref-active="actived" class="ng-binding actived"
                                           href="LogWarn.html">统计</a>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <section class="content">
            <div id="interactive" style="width: 1200px;height: 250px;"></div>
        </section><!-- /.content -->
        <section class="content">
            <div id="interactive1" style="width: 1200px;height: 250px;"></div>
        </section><!-- /.content -->
    </aside><!-- /.right-side -->
</div><!-- ./wrapper -->
<script src="../static/js/right/jquery.min.js"></script>
<!-- jQuery 2.0.2 -->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<!-- Bootstrap -->
<script src="../static/js/bootstrap.min.js" type="text/javascript"></script>
<!-- AdminLTE App -->
<script src="../static/js/AdminLTE/app.js" type="text/javascript"></script>
<script src="../static/js/echarts.min.js"></script>

<!-- Page script -->
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('interactive'));
    // 新建productName与nums数组来接受数据，因为我们
    var date = [];
    var count = [];
    //AJAX接收数据主体
    $.ajax({
        type: "GET",
        url: "/project",
        dataType: "json",
        async: false,
        success: function (result) {

            for (var i = 0; i < result.length; i++) {
                date.push(result[i].date);
                count.push(result[i].count);
            }

        },
        error: function (errorMsg) {
            alert("获取后台数据失败！");
        }
    });
    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '近一周告警情况'
        },
        toolbox: {
            show : true,
            feature : {
                mark : {show: true},
                dataView : {show: true, readOnly: false},
                magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
                restore : {show: true},
                saveAsImage : {show: true}
            }
        },
        tooltip: {},
        legend: {
            data: ['告警数']
        },
        xAxis: {
            //结合
            data: date
        },
        yAxis: {},
        series: [{
            name: '告警数',
            type: 'line',
            smooth: true,
            //结合
            data: count
        }]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
<script type="text/javascript">
    // 基于准备好的dom，初始化echarts实例
    var myChart = echarts.init(document.getElementById('interactive1'));
    // 新建productName与nums数组来接受数据，因为我们
    var avgrecov = [];
    var avgresp = [];
    //AJAX接收数据主体
    $.ajax({
        type: "GET",
        url: "/project",
        dataType: "json",
        async: false,
        success: function (result) {

            for (var i = 0; i < result.length; i++) {
                avgrecov.push(result[i].avgrecov);
                avgresp.push(result[i].avgresp);
            }

        },
        error: function (errorMsg) {
            alert("获取后台数据失败！");
        }
    });
    // 指定图表的配置项和数据
    var option = {
        title: {
            text: '近一周平均响应/平均恢复'
        },
        toolbox: {
            show : true,
            feature : {
                mark : {show: true},
                dataView : {show: true, readOnly: false},
                magicType : {show: true, type: ['line', 'bar', 'stack', 'tiled']},
                restore : {show: true},
                saveAsImage : {show: true}
            }
        },
        tooltip: {},
        legend: {
            data: ['平均响应', '平均恢复']
        },
        xAxis: {
            //结合
            data: date
        },
        yAxis: {},
        series: [
            {
                name: '平均恢复',
                type: 'line',
                smooth: true,
                //结合
                data: avgrecov
            },
            {
                name: '平均响应',
                type: 'line',
                smooth: true,
                //结合
                data: avgresp
            }
        ]
    };
    // 使用刚指定的配置项和数据显示图表。
    myChart.setOption(option);
</script>
<script type="text/javascript">
    function getUrl() {
        const myurl = '/getWarnLogs?id=' + $("#MName3").val();
        ;
        $("#getform").attr("action", myurl);
    }
</script>
</body>
</html>